#ifndef CSCREEN_H
#define CSCREEN_H

#include "CGraphics.h"
#include "CInput.h"
#include "CScreenManager.h"
#include <QMessageBox>

struct TMLabel {
    TMLabel() {}
    TMLabel( QString text, int x, int y, QFont font, int action )
    {
        set( text, x, y, font, action );
    }
    void set( QString text, int x, int y, QFont font, int action )
    {
        this->text = text; this->x = x; this->y = y; this->action = action;
        QFontMetrics f( font );
        width = f.width( text ); height = f.height();
        x2 = x + width; y2 = y - height;
        fade = 0.0;
    }

    QString text;
    int x, y;
    int width, height;
    int x2, y2;
    int action;
    double fade;
};

class CScreen
{

public:
    CScreen( QString name );
    ~CScreen();

    virtual void load( CGraphics *gl ) = 0;
    virtual void unload( CGraphics *gl ) = 0;
    virtual int update( CInput *in ) = 0;
    virtual void draw( CGraphics *gl ) = 0;

    void setScreenManager( CScreenManager *sm );

    QString getName() const;
    bool isHidden();
    void setHidden( bool hidden );

protected:

    QString name;
    bool hidden;
    CScreenManager *sm;

};

#endif // CSCREEN_H
